<?php
/**
 * Created by PhpStorm.
 * User: CPR137
 * Date: 2017/8/28
 * Time: 15:37
 */

namespace app\modules\home\controllers;


use metacms\base\Des3;
use metacms\base\Dex3;
use metacms\base\Hooks;

class TestController
{
    public function index1()
    {

        //添加钩子
        Hooks::getInstance()->add_action('test_action', 'print_g');
        //执行钩子
        hooks::getInstance()->do_action('test_action', $this->siteInfo);//也可以使用 Hook::do_action();
        //  return $this->render('Test/index', []);
    }

    public function des()
    {
        $dex = new Dex3('123456');
        //echo $dex->encrypt(json_encode($_SERVER));
        $aaa = 'owqrjNdjsmH1HwGz6O8KkG5Einmwfn7Xt4HLiuYDRwYPfQ70hTkWkyw43QWQ7sKJK9xK2Q9VbRIAo4M0ILvbtxu4oDVrerJPT9cxtTLqJZUi9QOHQha2eLPuodhvgzBhoYbcdAnS7lazRtNI7e9GBf1OUOMUfWdEUE+cHyCdigzUzFq8NnMEhLsamwtC9RM4yiQbMm/dqWhls5IaHODCSaFwGCvJilGlPaENCqYFl6tELLI2u3z37JZHFjNckwmRDLvV2Kcuy7ho7MwJ5KgpDTtVqukB/JfQBKvWm/P7kqMmj1KPH0f8XaKxm612etFgbMRALdBNtWy8yQ05/CEc0CpEzUlm15ivQlgOAi8f/zqQYIZeFwYsA7GY8GsM1ralMg+jwWbQ9Irez6pFBmMzw3fh09YA21CTKvbz8PHwI2+iJW6zvc1GveR/Dzs78fBjZLHYoq74P7SvlAU0cr5oYNnYLvopZPePTK+fCmiqgDT6PXX+jU8E+sWHVdum/YspOdiWGsYiosClZOrgPot0sfbu0mLxUNDbLyPPxApSxvEHK8yhYL0ReGpw59Oo5CPZbDEAJCxJK7E8DvjhCbU24InLVX6yYSbmWU407WdPE/4uwp3NsLt29I2AvQqlJLu1fTHQqgEpOlYFFppVh6Rl851ghy+xcyy80M1hYpQ4LXqLYjBOaq3I0YlH45dd+U9SwqMC0y/5ZQjxCuebA3tXwh5H0JhzF+rnuacylmpH6uDWWcVLf+BD60IPSUkX7/MZMRComhwH33m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rNhIEcmFjnksdQt6CQlojJGw0eVyoDhoqEHkWjEgHNm9ka5UbrLgzexhjSg+jVt8+o4Rr7O/WwJUHXQFzt3VIq4lnA/8k4dFvSySJj+m2a5LRunDBLJxlpvLzD70PwCM0tyLfqssQ1xgWYG85VWR07431xuWw/qsMHkQdpoxj4MvNSvbZhEvTgKBzK7JO/8NtS2wfF1/mP1+hBl5mUGcVa+mMtpDocHLRl6Q2d4pqtoPz9EMS24nTyOQXNJ6ibtOiduhrpniWxV2oEcdF5TfKvo1LENiZ0UNG9FSc2oZhiCtSUrh1HUJTMIWBQIeM0KYiJyiunYmYY1T11SPb6QL51Ft6BO3fUDN46nFM0SVgpW7FmG+ByAjMzTI2NS+lvRyLrCRccCyKwFUp77TCsf8L8drjMS+AzW7y6zTOigF74zk+Oz1Ryw9RvgWPRwJfXBFIhbe0D0HwfJmq1jtXiRVK5b3+6Vm9S4qd7U4ic+2+NKamFmVm0GU21tTT0Z22jWQ9RJOsVzoUmfvp1E/B/Z4v5+1ifDPtXqLbzZWHHMQdAKKa6iOCcqFlDoRes969wqdyNP2KA81dK7pqtWbR/OfA7MEEGNy4gyQAjfFbH9Ngh1k8EWJjCeSSAXKhOjk00Ktkd7Tru+UGN2DlUypuQOyWmXKYLYoJGr9e9sWyaINpUAI19KwjXYi5FsMqXDx2BMOPFSptjodPYtQufhF9GODcqzdnclGkA+/ygs=';
        $bbb = $dex->decrypt($aaa);
        print_g(json_decode($bbb));
    }

    public function index()
    {
        $input = '123456789';
        $code = 'vAG1rqq7ANqjBatCHqBeDw==';
        $dex3 = new Dex3();
        $des3 = new Des3();
        $mi = $dex3->encrypt($input);
        $oi = $des3->encrypt($input);
        var_dump($mi, $oi);
        $md = $dex3->decrypt($code);
        $od = $des3->decrypt($code);
        var_dump($md, $od);

    }


}
